import request from '@/router/axios';
import config from '@/config/website'

//列表
export const quotationList = (current, size, equipment) => {
    return request({
        url: '/api/blade-sale/quotation/page',
        method: 'get',
        params: {
            current,
            size,
            ...equipment
        }
    })
}

//新建
export const quotationAdd = (data) => {
    return request({
        url: '/api/blade-sale/quotation/save',
        method: 'post',
        data
    })
}
//修改
export const quotationUpdate = (data) => {
    return request({
        url: '/api/blade-sale/quotation/update',
        method: 'post',
        data
    })
}
//查看
export const quotationView = (id) => {
    return request({
        url: '/api/blade-sale/quotation/detail',
        method: 'get',
        params: {
            id
        }
    })
}

//删除
export const quotationDel = (ids) => {
    return request({
        url: '/api/blade-sale/quotation/remove',
        method: 'post',
        params: {
            ids
        }
    })
}

//产品要求
export const productDetail = (id) => {
    return request({
        url: '/api/blade-sale/quotationproduct/detail',
        method: 'get',
        params: {
            id
        }
    })
}
export const productSave = (data) => {
    return request({
        url: '/api/blade-sale/quotationproduct/update',
        method: 'post',
        data
    })
}
//提交
export const quotationSubmit = (id) => {
    return request({
        url: '/api/blade-sale/quotation/start-process',
        method: 'post',
        params: {
            id,
        }
    })
}
//查询项目名称
export const getProName = () => {
    return request({
        url: '/api/hg-public/hg_project/potentialProject/getPotentialProjects',
        method: 'get',
    })
}
//产品报价单
export const getProductList = (quotationId,equipment) => {
    return request({
        url: '/api/blade-sale/quotationproduct/list',
        method: 'get',
        params:{
            quotationId,
            ...equipment
        }
    })
}